package com.example.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultCode {

    SUCCESS(200, "操作成功"),
    ERROR(500, "操作失败"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "无权限"),
    VALIDATE_FAILED(404, "参数检验失败"),
    SYSTEM_ERROR(500, "系统异常"),

    // 业务异常
    USER_NOT_FOUND(1001, "用户不存在"),
    USER_DISABLED(1002, "用户已被禁用"),
    USERNAME_EXISTS(1003, "用户名已存在"),
    PASSWORD_ERROR(1004, "用户名或密码错误"),
    ROLE_NOT_FOUND(1005, "角色不存在"),
    MENU_NOT_FOUND(1006, "菜单不存在"),
    MENU_HAS_CHILDREN(1007, "存在子菜单，无法删除"),
    ROLE_HAS_USERS(1008, "角色已被用户使用，无法删除");

    private final Integer code;
    private final String message;
} 